package com.eapi.project.utils.alioss;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@Component
@Slf4j
public class AliOSSImageUpload {
    @Autowired
    private AliOSSUtils aliOSSUtils;
    public String upload(MultipartFile image) throws IOException {
        log.info("上传文件名称为：{}",image.getOriginalFilename());
        String url = aliOSSUtils.upload(image);
        log.info("文件的url为：{}",url);
        return url;
    }

}
